<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .app{
            width: 600px;
            height: 600px;
            background: pink;
            margin: 0 auto;
        }
        .app > div{
            height: 80px;
            border: 1px solid #000;
        }
        .app > button{
            width: 66px;
            height: 66px;
            display: block;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <div class="app">
        <div>{{name}}</div>
        <hello></hello>
        <!-- v-if 的使用 传入 一个布尔值 如果为 true 则使其所在dom元素显示，如果为flase则消失 -->
        <h1 v-if="flag">v-if</h1>
        <button @click="flag = !flag">变换</button>
    </div>
    <template id="asd">
        <div>
            <h1>阿松大</h1>
        </div>
    </template>
</body>
</html>
<script>
    const app = Vue.createApp({
        data(){
            return{
                el:'.app',
                name:'ming',
                flag:true
            }
        }
    })
    app.component(
        'hello',
        {
            template:'#asd'
        }
    )
    app.mount('.app')
</script>